.grain-list {
  overflow: auto;
  padding: 32px;
  @media #{$mobile} {
    padding: 0px 8px;
  }
  background-color: $grainlist-background-color;
  color: $grainlist-foreground-color;

  .question-mark {
    @extend %button-base;
    @extend %button-secondary;
    border: none;
    background-color: inherit;
    background-image: url("/question-a9a9a9.svg");
    background-size: 24px 24px;
    background-position: center;
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: top;
  }
  .question-mark:hover {
    background-image: url("/question-727272.svg");
    background-color: inherit;
  }

  >h1 {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;

    margin-top: 0px;
    padding-top: 0px;
    padding-bottom: 12px;
    border-bottom: 1px solid $default-rule-color;
    margin-bottom: 12px;

    font-size: 24pt;
    font-weight: 400;
  }

  >.maybe-row {
    margin-bottom: 12px;
    @media #{$desktop} {
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      justify-content: space-between;
    }
    @media #{$mobile} {
      display: block;
    }
  }

  .search-row {
    @extend %search-row;

    flex: 1 1 auto;
    vertical-align: top;
    clear: both;

    @media #{$mobile} {
      display: block;
      margin-bottom: 12px;
    }
  }

  >.trash-explanation {
    @extend %trash-explanation;
  }

  .usage-info {
    margin-left: 4px;
    padding: 8px;
    border-radius: 4px;
    background-color: white;
    >p { margin: 0; }
  }

  >table {
    @extend %grain-table;
  }

  >.no-grains {
    width: 100%;
    background-color: white;
    overflow: hidden;  // don't let margins escape box
    >p {
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
    }
  }
}

%trash-explanation {
  width: 100%;
  font-size: 10pt;

  button.empty-trash {
    @include unstyled-button();
    color: $sandstorm-purple-color;
    font-weight: bold;
  }
}

%bulk-action-buttons {
  float: left;
  clear: left;
  >button {
    @extend %button-base;
    @extend %button-secondary;
    display: inline-block;
    float: left;
    font-size: 14pt;
    line-height: 16pt;
    height: 32px;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 10px;
  }
}

%grain-table {
  width: 100%;
  padding: 0;
  margin: 8px 0 0 0;
  border-collapse: collapse;
  background-color: rgba(255, 255, 255, 0.5);
  >thead>tr {
    background-color: $grainlist-table-header-background-color;
    color: $grainlist-table-header-foreground-color;
    font-weight: 600;
    border-bottom: 1px solid #aaa;
    >td {
      border: 1px solid white;
      &.grain-name:hover, &.grain-size:hover, &.last-used:hover {
        background-color: $grainlist-table-header-background-color-hover;
        cursor: pointer;
      }
      &.grain-size {
        width: 70px;
        // The mobile viewport is too small to display this much text
        @media #{$mobile} {
          display: none;
        }
      }
      &.last-used {
        width: 110px;
      }
      &.shared-or-owned {
        width: 110px;
        // The mobile viewport is too small to display this much text
        @media #{$mobile} {
          display: none;
        }
      }
      &.td-app-icon {
        width: 64px;
        padding-left: 16px;
      }
      &.select-all-grains {
        width: 20px;
      }
    }
  }
  >tbody>tr {
    width: 100%;
    height: 32px;
    background-color: $grainlist-table-row-background-color;
    color: $grainlist-table-row-foreground-color;
    border-bottom: 1px solid $grainlist-table-row-outline-color;
    border-left: 1px solid #fff;
    border-right: 1px solid #fff;

    &.unread {
      background-color: $grainlist-table-row-background-color-unread;
    }

    >td {
      position: relative;
      &.td-app-icon {
        >.app-icon {
          @extend %pseudo-img-tag;
          width: 24px;
          height: 24px;
        }
        width: 64px;
        padding-left: 16px;
        &.in-trash {
          padding-left: 30px;

          @extend .icon-trash;
          &::before {
            position: absolute;
            left: 4px;
            top: 4px;
            font-size: 20px;
            @extend .icon;
          }
        }
      }
      &.grain-size {
        width: 70px;
        // The mobile viewport is too small to display this much text
        @media #{$mobile} {
          display: none;
        }
      }
      &.last-used {
        width: 110px;
      }
      &.shared-or-owned {
        width: 110px;
        // The mobile viewport is too small to display this much text
        @media #{$mobile} {
          display: none;
        }
      }
    }
    &.action {
      cursor: pointer;
      background-color: $grainlist-table-row-action-background-color;
      &:hover {
        background-color: $grainlist-table-row-action-background-color-hover;
        >td>.new-grain-icon {
          background-image: url("/plus-6A237C.svg");
        }
      }
      >td.td-app-icon {
        font-weight: bold;
        font-size: 32px;
        color: #9E40B5;
      }
      >td {
        >.new-grain-icon {
          @extend %pseudo-img-tag;
          width: 24px;
          height: 24px;
          background-image: url("/plus-9E40B5.svg");
        }
      }
      button {
        @include unstyled-button();
        color: black;
        font-weight: bold;
      }
    }
    &.grain {
      .click-to-go {
        cursor: pointer;
      }
      &:hover {
        background-color: $grainlist-table-row-background-color-hover;
      }
    }
  }
}
